using System;
using System.Collections.Generic;
using System.Net.Mail;

namespace Payroll.BusinessLogic.Messages
{
    /// <summary>
    /// Message service
    /// </summary>
    public partial interface IMessageService
    {
        /// <summary>
        /// Sends an email
        /// </summary>
        /// <param name="subject">Subject</param>
        /// <param name="body">Body</param>
        /// <param name="from">From</param>
        /// <param name="to">To</param>
        /// <param name="emailAccount">Email account to use</param>
        void SendEmail(string subject, string body, string from, string to,
            EmailAccounts emailAccount);

        /// <summary>
        /// Sends an email
        /// </summary>
        /// <param name="subject">Subject</param>
        /// <param name="body">Body</param>
        /// <param name="from">From</param>
        /// <param name="to">To</param>
        /// <param name="emailAccount">Email account to use</param>
        void SendEmail(string subject, string body, MailAddress from,
            MailAddress to, EmailAccounts emailAccount);

        /// <summary>
        /// Sends an email
        /// </summary>
        /// <param name="subject">Subject</param>
        /// <param name="body">Body</param>
        /// <param name="from">From</param>
        /// <param name="to">To</param>
        /// <param name="bcc">BCC</param>
        /// <param name="cc">CC</param>
        /// <param name="emailAccount">Email account to use</param>
        void SendEmail(string subject, string body,
            MailAddress from, MailAddress to, List<string> bcc,
            List<string> cc, EmailAccounts emailAccount);
        /// <summary>
        /// Sends the email.
        /// </summary>
        /// <param name="subject">The subject.</param>
        /// <param name="body">The body.</param>
        /// <param name="from">From.</param>
        /// <param name="to">To.</param>
        /// <param name="bcc">The BCC.</param>
        /// <param name="fileAttachment">The file attachment.</param>
        /// <param name="cc">The cc.</param>
        /// <param name="emailAccount">The email account.</param>
        void SendEmail(string subject, string body,
            MailAddress from, MailAddress to, List<string> bcc, List<string> fileAttachment,
            List<string> cc, EmailAccounts emailAccount);
        /// <summary>
        /// Gets all queued emails.
        /// </summary>
        /// <param name="queuedEmailCount">The queued email count.</param>
        /// <param name="loadNotSentItemsOnly">if set to <c>true</c> [load not sent items only].</param>
        /// <param name="maxSendTries">The max send tries.</param>
        /// <returns></returns>
        List<QueuedEmail> GetAllQueuedEmails(int queuedEmailCount,
            bool loadNotSentItemsOnly, int maxSendTries);
        /// <summary>
        /// Gets all queued emails.
        /// </summary>
        /// <param name="fromEmail">From email.</param>
        /// <param name="toEmail">To email.</param>
        /// <param name="startTime">The start time.</param>
        /// <param name="endTime">The end time.</param>
        /// <param name="queuedEmailCount">The queued email count.</param>
        /// <param name="loadNotSentItemsOnly">if set to <c>true</c> [load not sent items only].</param>
        /// <param name="maxSendTries">The max send tries.</param>
        /// <returns></returns>
        List<QueuedEmail> GetAllQueuedEmails(string fromEmail,
            string toEmail, DateTime? startTime, DateTime? endTime,
            int queuedEmailCount, bool loadNotSentItemsOnly, int maxSendTries);
        /// <summary>
        /// Gets or sets the default email account.
        /// </summary>
        /// <value>
        /// The default email account.
        /// </value>
        EmailAccounts DefaultEmailAccount { get; set; }
        /// <summary>
        /// Updates the queued email.
        /// </summary>
        /// <param name="queuedEmail">The queued email.</param>
        void UpdateQueuedEmail(QueuedEmail queuedEmail);
        /// <summary>
        /// Gets the default mail send. Mail to
        /// </summary>
        /// <value>
        /// The default mail send.
        /// </value>
        string DefaultMailSend { get; }
        /// <summary>
        /// Saves the queued email.
        /// </summary>
        /// <param name="queuedEmail">The queued email.</param>
        void SaveQueuedEmail(QueuedEmail queuedEmail);
        /// <summary>
        /// Saves the queued email.
        /// </summary>
        /// <param name="queuedEmail">The queued email.</param>
        /// <param name="result">The result.</param>
        void SaveQueuedEmail(QueuedEmail queuedEmail, string MessageId);
        /// <summary>
        /// Saves the queued email.
        /// </summary>
        /// <param name="MessageId">The message id.</param>
        /// <param name="PhysicalApplicationPath">The physical application path.</param>
        void SaveQueuedEmail(string MessageId, string PhysicalApplicationPath);
        #region ReceiveMails

        #endregion
        /// <summary>
        /// Saves the email accounts.
        /// </summary>
        /// <param name="emailAccount">The email account.</param>
        void SaveEmailAccounts(EmailAccounts emailAccount);
        /// <summary>
        /// Gets the email accounts.
        /// </summary>
        /// <returns></returns>
        EmailAccounts GetEmailAccounts();
        /// <summary>
        /// Gets the messge.
        /// </summary>
        /// <param name="packageCode">The package code.</param>
        /// <param name="fromdate">The fromdate.</param>
        /// <param name="todate">The todate.</param>
        /// <param name="Distributor">The distributor.</param>
        /// <param name="customerName">Name of the customer.</param>
        /// <param name="taxcode">The taxcode.</param>
        /// <param name="mobile">The mobile.</param>
        /// <param name="email">The email.</param>
        /// <param name="confrim">The confrim.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <returns></returns>
        List<MessageMails> GetMessge(string packageCode = null, string fromdate = null, string todate = null, string Distributor = null, string customerName = null, string taxcode = null, string mobile = null, string email = null, int? confrim = 3, int pageSize = int.MaxValue, int pageIndex = 0);
        List<MessageMails> Delete(string MessageId, string packageCode = null, string fromdate = null, string todate = null, string Distributor = null, string customerName = null, string taxcode = null, string mobile = null, string email = null, int? confrim = 3, int pageSize = int.MaxValue, int pageIndex = 0);
    }
}